package setupdb;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

public class SimpleDB {

	private BufferedWriter writer;

	public SimpleDB(String filename) {
		try {
			writer = new BufferedWriter(new FileWriter(new File(
					Main.DB_OUT_FOLDER, filename)));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public SimpleDB(File file) {
		try {
			writer = new BufferedWriter(new FileWriter(file));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public void writeln(String text) {
		try {
			writer.write(text + "\r\n");
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public void closedDB() {
		try {
			writer.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
